package com.gopay.common.domain.cbrmb;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Version;

import com.gopay.common.domain.BaseEntity;

/**
 * 
 * @ClassName: CbRmbAccountCapitalDtl
 * @Description: 跨境人民币专属账户资金来源表
 * @author huangcheng
 * @date 2016年7月6日 上午10:59:01
 */
@Entity
@Table(name = "CB_RMB_ACCOUNT_CAPITAL_DTL")
public class CbRmbAccountCapitalDtl extends BaseEntity {

    private static final long serialVersionUID = -8652092016017375009L;

    private int capitalSq;

    /**
     * 账户ID
     */
    private String acctId;

    private String gopayOrderId;

    /**
     * 收支方向(S-收入,Z-支出)
     */
    private String capitalOpt;

    /**
     * 交易金额
     */
    private BigDecimal tranAmt;

    /**
     * 交易之前余额
     */
    private BigDecimal tranBeforeAmt;

    /**
     * 交易之后余额
     */
    private BigDecimal tranAfterAmt;



    /**
     * 交易时间
     */
    private Date tranTime;

    /**
     * 01--网关 02--境内 03--境外
     */
    private String capitalSource;

    /**
     * 更新时间
     */
    private Date updateTime;

    private String remark1;

    private String remark2;

    private int version;

    public CbRmbAccountCapitalDtl() {
    }

    public CbRmbAccountCapitalDtl(int capitalSq) {
        setCapitalSq(capitalSq);
    }

  

	public CbRmbAccountCapitalDtl(int capitalSq, String acctId,
			String gopayOrderId, String capitalOpt, BigDecimal tranAmt,
			BigDecimal tranBeforeAmt, BigDecimal tranAfterAmt, Date tranTime,
			String capitalSource, Date updateTime, String remark1,
			String remark2, int version) {
		super();
		this.capitalSq = capitalSq;
		this.acctId = acctId;
		this.gopayOrderId = gopayOrderId;
		this.capitalOpt = capitalOpt;
		this.tranAmt = tranAmt;
		this.tranBeforeAmt = tranBeforeAmt;
		this.tranAfterAmt = tranAfterAmt;
		this.tranTime = tranTime;
		this.capitalSource = capitalSource;
		this.updateTime = updateTime;
		this.remark1 = remark1;
		this.remark2 = remark2;
		this.version = version;
	}

	@Id
	@SequenceGenerator(name="CbRmbAccountCapitalDtlSeq",sequenceName="CB_RMB_ACCOUNT_CAPITAL_DTL_SQ")
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CbRmbAccountCapitalDtlSeq")
    @Column(name = "CAPITAL_SQ", unique = true, nullable = false)
    public int getCapitalSq() {
        return this.capitalSq;
    }

    public void setCapitalSq(int capitalSq) {
        this.capitalSq = capitalSq;
    }

    @Column(name = "ACCT_ID", length = 19)
    public String getAcctId() {
        return this.acctId;
    }

    public void setAcctId(String acctId) {
        this.acctId = acctId;
    }

    @Column(name = "GOPAY_ORDER_ID", length = 30)
    public String getGopayOrderId() {
        return this.gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Column(name = "CAPITAL_OPT", length = 1)
    public String getCapitalOpt() {
        return this.capitalOpt;
    }

    public void setCapitalOpt(String capitalOpt) {
        this.capitalOpt = capitalOpt;
    }

    @Column(name = "TRAN_AMT", precision = 25, scale = 4)
    public BigDecimal getTranAmt() {
        return this.tranAmt;
    }

    public void setTranAmt(BigDecimal tranAmt) {
        this.tranAmt = tranAmt;
    }

    @Column(name = "TRAN_BAL_BEFORE_AMT", precision = 25, scale = 4)
    public BigDecimal getTranBeforeAmt() {
		return tranBeforeAmt;
	}

	public void setTranBeforeAmt(BigDecimal tranBeforeAmt) {
		this.tranBeforeAmt = tranBeforeAmt;
	}
	
	@Column(name = "TRAN_BAL_AFTER_AMT", precision = 25, scale = 4)
	public BigDecimal getTranAfterAmt() {
		return tranAfterAmt;
	}

	public void setTranAfterAmt(BigDecimal tranAfterAmt) {
		this.tranAfterAmt = tranAfterAmt;
	}


    @Column(name = "TRAN_TIME")
    public Date getTranTime() {
        return this.tranTime;
    }

    public void setTranTime(Date tranTime) {
        this.tranTime = tranTime;
    }

    @Column(name = "CAPITAL_SOURCE", length = 2)
    public String getCapitalSource() {
        return this.capitalSource;
    }

    public void setCapitalSource(String capitalSource) {
        this.capitalSource = capitalSource;
    }

    @Column(name = "UPDATE_TIME")
    public Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "REMARK1", length = 100)
    public String getRemark1() {
        return this.remark1;
    }

    public void setRemark1(String remark1) {
        this.remark1 = remark1;
    }

    @Column(name = "REMARK2", length = 100)
    public String getRemark2() {
        return this.remark2;
    }

    public void setRemark2(String remark2) {
        this.remark2 = remark2;
    }

    @Version
    @Column(name = "VERSION", precision = 22, scale = 0)
    public int getVersion() {
        return this.version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

}
